package com.study;

import com.study.config.MyConfig;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * 问:maven compile后,我想看看target目录,结果没有???
 * project structure->module->exculde->默认把targe勾选了..->去掉即可.
 */
//todo!!!!!!!!!!!!!!!!!!!!   我自己测试了mybatisplus,
//		acShareLogMapper.insert(acShareLog);
//lombok装了插件还要加jar才行????相当于写了Logger log = LoggerFactory.getLogger(MyspringbootApplication.class);
@Slf4j
@SpringBootApplication
public class MyspringbootApplication {


    public static void main(String[] args) {
        ConfigurableApplicationContext appcon = SpringApplication.run(MyspringbootApplication.class, args);
        //从容器中取出myconf(注意是代理对象,EnhancerBySpring(CGLIB)原因后面讲)
        MyConfig myConfBean = appcon.getBean(MyConfig.class);
        System.out.println(myConfBean.person1());
        //有了myconf对象调其中方法2次,按java基础来看应该new 2个person,实际却是单例的!!核心在@Configuration中proxyBeanMethods
        System.out.println(myConfBean.person1());
        //slf4j 接口层的历史来源

        // .error>.warn>.info>.debugg>.trace

        log.error("error");
        log.warn("warn");
        log.info("info");
        //springBoot默认级别>=info,跑一下就知道了.
        log.debug("debug");
        log.trace("trance");
        //org.sl4j包
        Logger logger = LoggerFactory.getLogger(MyspringbootApplication.class);
        System.out.println(log.getClass().getTypeName());
        System.out.println(logger.getClass().getTypeName());//和上一行同,


    }
}

